package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementSrSrtpPathMapper;
import com.ruoyi.net.domain.ElementSrSrtpPath;
import com.ruoyi.net.service.IElementSrSrtpPathService;

/**
 * 网元-SR-srtp-路径参数Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementSrSrtpPathServiceImpl implements IElementSrSrtpPathService 
{
    @Autowired
    private ElementSrSrtpPathMapper elementSrSrtpPathMapper;

    /**
     * 查询网元-SR-srtp-路径参数
     * 
     * @param id 网元-SR-srtp-路径参数主键
     * @return 网元-SR-srtp-路径参数
     */
    @Override
    public ElementSrSrtpPath selectElementSrSrtpPathById(String id)
    {
        return elementSrSrtpPathMapper.selectElementSrSrtpPathById(id);
    }

    /**
     * 查询网元-SR-srtp-路径参数列表
     * 
     * @param elementSrSrtpPath 网元-SR-srtp-路径参数
     * @return 网元-SR-srtp-路径参数
     */
    @Override
    public List<ElementSrSrtpPath> selectElementSrSrtpPathList(ElementSrSrtpPath elementSrSrtpPath)
    {
        return elementSrSrtpPathMapper.selectElementSrSrtpPathList(elementSrSrtpPath);
    }

    /**
     * 新增网元-SR-srtp-路径参数
     * 
     * @param elementSrSrtpPath 网元-SR-srtp-路径参数
     * @return 结果
     */
    @Override
    public int insertElementSrSrtpPath(ElementSrSrtpPath elementSrSrtpPath)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementSrSrtpPath.getId())) {
            elementSrSrtpPath.setId(uuid);
        }
        elementSrSrtpPath.setCreateBy(SecurityUtils.getUsername());
        elementSrSrtpPath.setCreateTime(DateUtils.getNowDate());
        elementSrSrtpPath.setUpdateBy(SecurityUtils.getUsername());
        elementSrSrtpPath.setUpdateTime(DateUtils.getNowDate());
        return elementSrSrtpPathMapper.insertElementSrSrtpPath(elementSrSrtpPath);
    }

    /**
     * 修改网元-SR-srtp-路径参数
     * 
     * @param elementSrSrtpPath 网元-SR-srtp-路径参数
     * @return 结果
     */
    @Override
    public int updateElementSrSrtpPath(ElementSrSrtpPath elementSrSrtpPath)
    {
        elementSrSrtpPath.setUpdateBy(SecurityUtils.getUsername());
        elementSrSrtpPath.setUpdateTime(DateUtils.getNowDate());
        return elementSrSrtpPathMapper.updateElementSrSrtpPath(elementSrSrtpPath);
    }

    /**
     * 批量删除网元-SR-srtp-路径参数
     * 
     * @param ids 需要删除的网元-SR-srtp-路径参数主键
     * @return 结果
     */
    @Override
    public int deleteElementSrSrtpPathByIds(String[] ids)
    {
        return elementSrSrtpPathMapper.deleteElementSrSrtpPathByIds(ids);
    }

    /**
     * 删除网元-SR-srtp-路径参数信息
     * 
     * @param id 网元-SR-srtp-路径参数主键
     * @return 结果
     */
    @Override
    public int deleteElementSrSrtpPathById(String id)
    {
        return elementSrSrtpPathMapper.deleteElementSrSrtpPathById(id);
    }
}
